# Reading a FASTA-file from the package extdata/ folder
# We need to uncompress it first...
extdata.path <- file.path(path.package("micropan"),"extdata")
filenames <- "Mpneumoniae_309_protein.fsa"
pth <- lapply( file.path( extdata.path, paste( filenames, ".xz", sep="" ) ), xzuncompress )
# Reading the file...
fdta <- readFasta(in.file=file.path(extdata.path,filenames))
# ...and compressing it again
pth <- lapply( file.path( extdata.path, filenames ), xzcompress )
# Plotting and printing the Fasta object
plot(fdta)
summary(fdta)
str(fdta)
# Writing the Fasta object to a new file
writeFasta(fdta,out.file="Delete_me.fsa")
Run the code above in your browser using DataLab